package xuegao.study.mall.repo.dao.ums;

import org.apache.ibatis.annotations.Param;
import xuegao.study.mall.common.domain.RoleResource;
import xuegao.study.mall.common.model.ums.UmsRole;
import xuegao.study.mall.common.model.ums.UmsRoleMenuRelation;
import xuegao.study.mall.common.model.ums.UmsRoleResourceRelation;

import java.util.List;
import java.util.Map;

public interface UmsRoleDao {

    List<UmsRole> selectList(Map<String, Object> params);

    List<UmsRole> selectByAdminId(@Param("adminId") Long adminId);

    int insertRole(UmsRole role);

    int updateRole(UmsRole role);

    int deleteById(@Param("id") Long id);

    int deleteMenuRoleRelationByRoleId(@Param("roleId") Long roleId);

    int batchSaveMenuRoleRelation(@Param("list") List<UmsRoleMenuRelation> list);

    int deleteResourceRoleRelationByRoleId(@Param("roleId") Long roleId);

    int batchSaveResourceRoleRelation(@Param("list") List<UmsRoleResourceRelation> list);

    List<RoleResource> getAllRoleResource();
}
